package com.zkw.group.service;

import com.zkw.group.entity.ProfesTermCourse;
import com.zkw.group.mapper.ProfesTermCourseMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ProfesTermCourseService {

    @Autowired
    private ProfesTermCourseMapper profesTermCourseMapper;

    //获取学期内课程列表
    public List<ProfesTermCourse> getAllProfesTermCourseList(String cname,String termname, int pageStart, int pageSize){
        return profesTermCourseMapper.getAllProfesTermCourseList(cname,termname,pageStart,pageSize);
    }

    //获取学期内课程条目数
    public int getProfesTermCourseCounts(String cname,String termname){
        return  profesTermCourseMapper.getProfesTermCourseCounts(cname,termname);
    }

    //添加学期内课程
    public int addProfesTermCourse(ProfesTermCourse profesTermCourse){
        return profesTermCourseMapper.addProfesTermCourse(profesTermCourse);
    }

    //删除指定学期内课程
    public int deleteProfesTermCourse(String cname){
        return profesTermCourseMapper.deleteProfesTermCourse(cname);
    }

    //获取要添加的课程的所有先修课程列表
    public List<String> getRelacnameList(String cname){
        return profesTermCourseMapper.getRelacnameList(cname);
    }

    //获取要添加课程的学期的之前学期的课程列表
    public List<String> getBeforecnameList(int ords){
        return profesTermCourseMapper.getBeforecnameList(ords);
    }
}
